package com.ruoyi.system.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.xml.crypto.Data;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 【请填写功能名称】对象 scb_ordersrecord
 * 
 * @author ruoyi
 * @date 2024-06-24
 */
public class recordE
{

    /** id */

    /** 姓名 */
    @ExcelProperty(value = "派发账期")
    @Excel(name = "派发账期")
    private String name;

    /** 手机 */
    @Excel(name = "地市")
    @ExcelProperty(value = "地市")
    private String phone;
    @Excel(name = "区县")
    @ExcelProperty(value = "区县")
    private String name2;
    @Excel(name = "用户号码")
    @ExcelProperty(value = "用户号码")
    private String name3;
    @Excel(name = "失效时间")
    @ExcelProperty(value = "失效时间")
    private String addname3;
    @Excel(name = "处理意见")
    @ExcelProperty(value = "处理意见")
    private String addname4;
    @Excel(name = "用户姓名")
    @ExcelProperty(value = "用户姓名")
    private String name4;
    @Excel(name = "接入方式")
    @ExcelProperty(value = "接入方式")
    private String name5;
    @Excel(name = "市场分类")
    @ExcelProperty(value = "市场分类")
    private String name6;
    @Excel(name = "安装地址")
    @ExcelProperty(value = "安装地址")
    private String name7;
    @Excel(name = "质差分类")
    @ExcelProperty(value = "质差分类")
    private String name8;
    @Excel(name = "代维账号")
    @ExcelProperty(value = "代维账号")
    private String name9;
    @Excel(name = "代维姓名")
    @ExcelProperty(value = "代维姓名")
    private String name10;
    @Excel(name = "代维关怀结果")
    @ExcelProperty(value = "代维关怀结果")
    private String name11;
    @Excel(name = "备注")
    @ExcelProperty(value = "备注")
    private String name12;
    @Excel(name = "ai质检结果")
    @ExcelProperty(value = "ai质检结果")
    private String name13;
    @Excel(name = "复核结果")
    @ExcelProperty(value = "复核结果")
    private String name14;
    @Excel(name = "回访时间_秒")
    @ExcelProperty(value = "回访时间_秒")
    private String name15;


    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getName2() {
        return name2;
    }

    public void setName2(String name2) {
        this.name2 = name2;
    }

    public String getName3() {
        return name3;
    }

    public void setName3(String name3) {
        this.name3 = name3;
    }

    public String getName4() {
        return name4;
    }

    public void setName4(String name4) {
        this.name4 = name4;
    }

    public String getName5() {
        return name5;
    }

    public void setName5(String name5) {
        this.name5 = name5;
    }

    public String getName6() {
        return name6;
    }

    public void setName6(String name6) {
        this.name6 = name6;
    }

    public String getName7() {
        return name7;
    }

    public void setName7(String name7) {
        this.name7 = name7;
    }

    public String getName8() {
        return name8;
    }

    public void setName8(String name8) {
        this.name8 = name8;
    }

    public String getName9() {
        return name9;
    }

    public void setName9(String name9) {
        this.name9 = name9;
    }

    public String getName10() {
        return name10;
    }

    public void setName10(String name10) {
        this.name10 = name10;
    }

    public String getName11() {
        return name11;
    }

    public void setName11(String name11) {
        this.name11 = name11;
    }

    public String getName12() {
        return name12;
    }

    public void setName12(String name12) {
        this.name12 = name12;
    }

    public String getName13() {
        return name13;
    }

    public void setName13(String name13) {
        this.name13 = name13;
    }

    public String getName14() {
        return name14;
    }

    public void setName14(String name14) {
        this.name14 = name14;
    }

    public String getName15() {
        return name15;
    }

    public void setName15(String name15) {
        this.name15 = name15;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }







    public String getAddname3() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
        LocalDateTime parseDate=LocalDate.parse(this.name,formatter).atStartOfDay();
        parseDate=parseDate.plusDays(15);
        String now = parseDate.format(formatter);
        addname3=now;
        return addname3;
    }

    public String getAddname4() {
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
        LocalDateTime parseDate=LocalDate.parse(this.name,formatter).atStartOfDay();
        parseDate=parseDate.plusDays(15);
        String add = parseDate.format(formatter);
        String now = LocalDateTime.now().format(formatter);
        if(this.name11.equals("客户明确表示无需上门")&&this.name13.equals("无需上门")){
            return "拟豁免";
        }else if(!this.name11.equals("客户明确表示无需上门")&&this.name13.equals("无需上门")){
            return "用户需要上门";
        }else if((now.compareTo(add)<0&&this.name13.equals("其他"))||(now.compareTo(add)<0&&this.name11.equals("—")&&this.name13.equals("—"))){
            return "工单已失效";

        }else if(now.compareTo(add)>=0&&this.name13.equals("其他")){
            return "质检不通过";
        }else if(!this.name11.equals("—")&&this.name13.equals("—")){
            return "已回访未质检";
        }
        else if(now.compareTo(add)>=0&&this.name11.equals("—")&&this.name13.equals("—")){
            return "失效时间内回访完毕";
        }else{
            return "";
        }
    }
}
